//The MIT License
//
//Copyright (c) <2011> <GEPAR - Grupo de Ensino e Pesquisa em Agroinformática e Rastreabilidade>
//
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:
//
//The above copyright notice and this permission notice shall be included in
//all copies or substantial portions of the Software.
//
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//THE SOFTWARE.

package gui;

import javax.swing.JOptionPane;

public class PanelConsultarTabulCons extends javax.swing.JPanel {

    /** Creates new form PanelConsultarTabulCons */
    public PanelConsultarTabulCons() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        lblTitulo = new javax.swing.JLabel();
        lblFiltro = new javax.swing.JLabel();
        txtFiltro = new javax.swing.JTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        tblTabulConsolidadas = new javax.swing.JTable();
        lblDataColeta = new javax.swing.JLabel();
        lblProduto = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        tblPrecos = new javax.swing.JTable();
        lblRespColeta = new javax.swing.JLabel();
        lblRespTabul = new javax.swing.JLabel();
        lblDataTabul = new javax.swing.JLabel();
        lblEstatisticasCaixa = new javax.swing.JLabel();
        lblPrecoMaxC = new javax.swing.JLabel();
        lblPrecoMinC = new javax.swing.JLabel();
        lblMediaC = new javax.swing.JLabel();
        lblModaC = new javax.swing.JLabel();
        lblMedianaC = new javax.swing.JLabel();
        lblModaU = new javax.swing.JLabel();
        lblMediaU = new javax.swing.JLabel();
        lblPrecoMinU = new javax.swing.JLabel();
        lblPrecoMaxU = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        lblMedianaU = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();

        lblTitulo.setFont(new java.awt.Font("Tahoma", 1, 14));
        lblTitulo.setText("Consultar tabulações consolidadas");

        lblFiltro.setText("Digite um filtro para as tabulações:");

        tblTabulConsolidadas.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Data", "Produto"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tblTabulConsolidadas.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblTabulConsolidadasMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(tblTabulConsolidadas);

        lblDataColeta.setText("Data da coleta:");

        lblProduto.setText("Produto:");

        tblPrecos.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null}
            },
            new String [] {
                "Número", "Preço da caixa (R$)", "Preço da unidade (R$)"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.Float.class, java.lang.Float.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        jScrollPane2.setViewportView(tblPrecos);

        lblRespColeta.setText("Responsável pela coleta:");

        lblRespTabul.setText("Responsável pela tabulação:");

        lblDataTabul.setText("Data da tabulação:");

        lblEstatisticasCaixa.setFont(new java.awt.Font("Tahoma", 1, 11));
        lblEstatisticasCaixa.setText("Estatísticas da caixa");

        lblPrecoMaxC.setText("Preço máximo:");

        lblPrecoMinC.setText("Preço mínimo:");

        lblMediaC.setText("Média:");

        lblModaC.setText("Moda:");

        lblMedianaC.setText("Mediana:");

        lblModaU.setText("Moda:");

        lblMediaU.setText("Média:");

        lblPrecoMinU.setText("Preço mínimo:");

        lblPrecoMaxU.setText("Preço máximo:");

        jLabel18.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel18.setText("Estatísticas da unidade");

        lblMedianaU.setText("Mediana:");

        jLabel1.setText("Tabulações disponíveis localmente");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 505, Short.MAX_VALUE)
                            .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 505, Short.MAX_VALUE)
                            .addComponent(lblTitulo, javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                .addComponent(lblFiltro)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtFiltro, javax.swing.GroupLayout.DEFAULT_SIZE, 334, Short.MAX_VALUE))
                            .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                .addComponent(lblDataColeta)
                                .addGap(18, 18, 18)
                                .addComponent(lblProduto)))
                        .addGap(302, 302, 302))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(lblEstatisticasCaixa)
                                    .addComponent(lblPrecoMaxC)
                                    .addComponent(lblPrecoMinC)
                                    .addComponent(lblMediaC))
                                .addGap(112, 112, 112)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel18)
                                    .addComponent(lblPrecoMaxU)
                                    .addComponent(lblPrecoMinU)
                                    .addComponent(lblMediaU)
                                    .addComponent(lblModaU)
                                    .addComponent(lblMedianaU)))
                            .addComponent(lblModaC)
                            .addComponent(lblMedianaC)
                            .addComponent(lblRespColeta)
                            .addComponent(lblRespTabul)
                            .addComponent(lblDataTabul))
                        .addContainerGap(450, Short.MAX_VALUE))))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lblTitulo)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblFiltro)
                    .addComponent(txtFiltro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblDataColeta)
                    .addComponent(lblProduto))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(lblRespColeta)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lblRespTabul)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lblDataTabul)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(lblEstatisticasCaixa)
                        .addGap(18, 18, 18)
                        .addComponent(lblPrecoMaxC)
                        .addGap(18, 18, 18)
                        .addComponent(lblPrecoMinC)
                        .addGap(18, 18, 18)
                        .addComponent(lblMediaC))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel18)
                        .addGap(18, 18, 18)
                        .addComponent(lblPrecoMaxU)
                        .addGap(18, 18, 18)
                        .addComponent(lblPrecoMinU)
                        .addGap(18, 18, 18)
                        .addComponent(lblMediaU)))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(lblModaC)
                        .addGap(18, 18, 18)
                        .addComponent(lblMedianaC))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(lblModaU)
                        .addGap(18, 18, 18)
                        .addComponent(lblMedianaU)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents


    private void tblTabulConsolidadasMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblTabulConsolidadasMouseClicked
      //testes de indice
        JOptionPane.showMessageDialog(null,this.tblTabulConsolidadas.getSelectedRow());

      // TODO add your handling code here:
    }//GEN-LAST:event_tblTabulConsolidadasMouseClicked


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JLabel lblDataColeta;
    private javax.swing.JLabel lblDataTabul;
    private javax.swing.JLabel lblEstatisticasCaixa;
    private javax.swing.JLabel lblFiltro;
    private javax.swing.JLabel lblMediaC;
    private javax.swing.JLabel lblMediaU;
    private javax.swing.JLabel lblMedianaC;
    private javax.swing.JLabel lblMedianaU;
    private javax.swing.JLabel lblModaC;
    private javax.swing.JLabel lblModaU;
    private javax.swing.JLabel lblPrecoMaxC;
    private javax.swing.JLabel lblPrecoMaxU;
    private javax.swing.JLabel lblPrecoMinC;
    private javax.swing.JLabel lblPrecoMinU;
    private javax.swing.JLabel lblProduto;
    private javax.swing.JLabel lblRespColeta;
    private javax.swing.JLabel lblRespTabul;
    private javax.swing.JLabel lblTitulo;
    private javax.swing.JTable tblPrecos;
    private javax.swing.JTable tblTabulConsolidadas;
    private javax.swing.JTextField txtFiltro;
    // End of variables declaration//GEN-END:variables

}
